import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertNotNull;

import java.io.File;

import org.junit.Before;
import org.junit.Test;



public class Correctness {


	private double[][] map;
	private double[][] basemapBlcNorip;
	private double[][] mapBlcNorip;


	@Before
	public void setUp1() throws Exception {
		String path = "C:/_IPHEx CBF/ims_files/NI24_0909171306_ims.csv";
		IMS_CSV_File file = new IMS_CSV_File(new File(path));
		map = file.getMap();
		
		System.out.println(map.length);
		System.out.println(map[0].length);
		
		String path2 = "C:/_IPHEx CBF/ims_files/NI24_0909171306_ims.csv";
		IMS_CSV_File file2 = new IMS_CSV_File(new File(path2));
		basemapBlcNorip = file2.getMap();
		//assertNotSame(map, mapBlcNorip);
		mapBlcNorip = ImageMethods.baselineCorrectionSpectraWise(basemapBlcNorip);
		mapBlcNorip = ImageMethods.substractSimilaritie(mapBlcNorip);
	}
	
		
	@Test
	public void correctResult(){
		map = ImageMethods.baselineCorrectionSpectraWise(map);
		map = ImageMethods.substractSimilaritie(map);
		double[][] map1 = EfficientMedianFilter.slowFilter(mapBlcNorip);
		double[][] map2 = EfficientMedianFilterLined.multithreadFilter(mapBlcNorip);
		
		assertNotNull(map1);
		assertNotNull(map2);
		assertArrayEquals(map1, map2);
	}
	
}
